(function (global) {
    /**
     * 这里其实还有很多，只参考其它的框架列出一些常用的。
     * @type {Object}
     */
    var attrMap = {
        "class":"className",
        "for":"htmlFor",
        tabindex:"tabIndex",
        readonly:"readOnly",
        maxlength:"maxLength",
        cellspacing:"cellSpacing",
        cellpadding:"cellPadding",
        rowspan:"rowSpan",
        colspan:"colSpan",
        usemap:"useMap",
        frameborder:"frameBorder",
        contenteditable:"contentEditable"
    };
    var attrHooks={
        'href':{
            'getter':function(element){
                return element.getAttribute('href',2);
            }
        }
    };
    var ln = {
        setAttribute:function (element, name, value) {
            if ('object' != typeof name) {
                //plugins start===
                var hook = attrHooks[name];
                if (hook && hook.setter) {
                    return hook.setter(element, name, value);
                }
                //plugins end ===
                name = attrMap[name] || name;
                if (name in element) {
                    //check/selected/href
                    element[name] = value;
                } else {
                    element.setAttribute(element, name, value);
                }
            } else {
                for (var attr in name) {
                    ln.setAttribute(element, attr, name[attr]);
                }
            }
        },
        getAttribute:function (element, name) {
            //plugins start===
            var hook = attrHooks[name];
            if (hook && hook.getter) {
                return hook.getter(element);
            }
            //plugins end ===
            name = attrMap[name] || name;
            if (name in element) {
                return element[name];
            } else {
                return element.setAttribute(element, name);
            }
        },
        removeAttribute:function (element, name) {
            //plugins start===
            var hook = attrHooks[name];
            if (hook && hook.remove) {
                return hook.remove(element, name);
            }
            //plugins end ===
            return element.removeAttribute(name);
        }
    };
    global.ln = ln;
}(window));